package com.lanou3g.demo.base.service;

import com.lanou3g.demo.entity.AdminInfo;
import com.lanou3g.demo.entity.ExAdminInfo;
import com.lanou3g.demo.mapper.LoginMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginService implements ILoginService {

    @Autowired
    private LoginMapper loginMapper;
    @Override
    public ExAdminInfo login(String adminCode, String password) {
        ExAdminInfo admin = loginMapper.findAdmin(adminCode);
        if (admin != null && admin.getPassword().equals(password)){
            return admin;
        }
        return null;
    }
}
